//
//  AccountControl.m
//  FreeTime
//
//  Created by  on 16/8/26.
//  Copyright © 2016年 SRDZ.com. All rights reserved.
//

#import "AccountControl.h"
#import "Header.h"
#import "ChangePhoneControl.h"
#import "ChangePasswordControl.h"
@interface AccountControl ()

@end

@implementation AccountControl
- (void)viewWillAppear:(BOOL)animated{
    self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupNav];
    [self setupUI];
}
#pragma mark -- selfStyle --
- (void)setupUI{
    self.navigationItem.title = @"账户信息";

    UIView * bgView = [[UIView alloc] init];
    NSArray * titleArr = @[@"姓名",@"生日",@"手机号码",@"修改密码"];
    for (int i = 0; i<4; i++) {
        UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.frame = CGRectMake(0, 50*i, WindowWidth, 50);
        [btn addTarget:self action:@selector(chooseBtn:) forControlEvents:UIControlEventTouchUpInside];
        btn.tag = 100+i;
        UILabel * titleLbl = [ReduceCode creatLabelWithFrame:CGRectMake(10, 0, 80, 50) title:titleArr[i] titleColor:[ImageUtil colorWithRgb:0x666666] font:14 textAlignment:0];
        [btn addSubview:titleLbl];
        UIImageView * img1 = [[UIImageView alloc] initWithFrame:CGRectMake(WindowWidth-35, 12.5, 25, 25)];
        img1.image = [UIImage imageNamed:@"pushArrow"];
        [btn addSubview:img1];
        UILabel * contentLbl = [ReduceCode creatLabelWithFrame:CGRectMake(WindowWidth-185, 0, 150, 50) title:@"13589989898" titleColor:[ImageUtil colorWithRgb:0x666666] font:14 textAlignment:2];
        contentLbl.backgroundColor = DEBUG_CLOLR;
        [btn addSubview:contentLbl];
        [bgView addSubview:btn];
        [ToolUtil createLine:49 superView:btn lift:10 width:WindowWidth-20 hight:1 color:[ImageUtil colorWithRgb:0xe6e6e6e6]];

    }
    bgView.frame = CGRectMake(0, 0, WindowWidth, WindowHeight);
    self.tableView.scrollEnabled = NO;
    self.tableView.tableHeaderView = bgView;
}
#pragma mark -- 响应事件 --
- (void)chooseBtn:(UIButton *)btn{
    
    if (btn.tag == 100) {
        
    }else if (btn.tag == 101){
        
    }else if (btn.tag == 102){
        ChangePhoneControl * changeVC = [ChangePhoneControl new];
        [self.navigationController pushViewController:changeVC animated:YES];
    }else if (btn.tag == 103){
        ChangePasswordControl * changeVC = [ChangePasswordControl new];
        [self.navigationController pushViewController:changeVC animated:YES];
    }
}
@end
